﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DataConnection.Interface;

namespace DataConnection.BE
{
    public  class DataOperation:IDataOperationInterface
    {
        DataConnectionManager dc = new DataConnectionManager();
        /// <summary>
        /// 得到查询结果
        /// </summary>
        /// <param name="strSql"></param>
        /// <returns></returns>
        public object SqlExecuteString(string strSql)
        {
            try
            {
                dc.GetSqlConnection();
                return dc.SqlExecuteString(strSql);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 得到datata
        /// </summary>
        /// <param name="strSql"></param>
        /// <returns></returns>
        public DataTable SqlExecuteGetDataTable(string strSql)
        {
            try
            {
                dc.GetSqlConnection();
                return dc.SqlExecuteGetDataTable(strSql);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

    }
}
